package com.demo.common.constant.api.base;

import com.demo.common.result.ResultVo;

import java.util.List;
import java.util.Map;

public abstract class AbstractController<T, K> {
    //测试
    public abstract String test();

    //查询所有
    public abstract ResultVo<List<T>> findAll();

    //根据Id查询
    public abstract ResultVo<T> findById(IDEntity<K> idt);

    //多条件查询
    public abstract ResultVo<List<T>> findByParams(Map<String, String> map);

    //查询总共有多少条记录
    public abstract ResultVo<Integer> findAllCount();

    //分页查询
    public abstract ResultVo findPage(Map<String, String> map);

    //增加
    public abstract ResultVo add(T entity);

    //修改
    public abstract ResultVo modify(T entity);

    //多条件修改
    public abstract ResultVo modifyByParams(T entity);

    //删除
    public abstract ResultVo remove(IDEntity<K> record);

    //批量删除
    public abstract ResultVo batchRemove(List<K> ids);

    //多条件删除
    public abstract ResultVo removeByParams(Map<String, String> map);
}
